package business

import (
	"github.com/flipped-aurora/gin-vue-admin/server/api/v1"
	"github.com/flipped-aurora/gin-vue-admin/server/middleware"
	"github.com/gin-gonic/gin"
)

type PeopleRouter struct {
}

// InitPeopleRouter 初始化 答题人员信息 路由信息
func (s *PeopleRouter) InitPeopleRouter(Router *gin.RouterGroup) {
	peopleRouter := Router.Group("people").Use(middleware.OperationRecord())
	peopleRouterWithoutRecord := Router.Group("people")
	var peopleApi = v1.ApiGroupApp.BusinessApiGroup.PeopleApi
	{
		peopleRouter.POST("createPeople", peopleApi.CreatePeople)             // 新建答题人员信息
		peopleRouter.DELETE("deletePeople", peopleApi.DeletePeople)           // 删除答题人员信息
		peopleRouter.DELETE("deletePeopleByIds", peopleApi.DeletePeopleByIds) // 批量删除答题人员信息
		peopleRouter.PUT("updatePeople", peopleApi.UpdatePeople)              // 更新答题人员信息
	}
	{
		peopleRouterWithoutRecord.GET("findPeople", peopleApi.FindPeople)       // 根据ID获取答题人员信息
		peopleRouterWithoutRecord.GET("getPeopleList", peopleApi.GetPeopleList) // 获取答题人员信息列表
	}
}
